//
//  BizMObject.h
//  BizClientKit
//
//  Created by Cool Camel on 16/3/14.
//  Copyright © 2016年 www.biz-united.com.cn. All rights reserved.
//

#import <objc/runtime.h>
#import <Foundation/Foundation.h>


@protocol IBizMObject <NSObject>
+ (nullable instancetype)serializeWithJsonObject:(nullable NSDictionary *)jsonObj;
- (nullable instancetype)initWithJsonObject:(nullable NSDictionary *)jsonObj;
- (nonnull NSDictionary *)toJsonObject;
@end

@interface BizMObject : NSObject<IBizMObject, NSCopying, NSCoding>

+ (nullable instancetype)serializeWithJsonObject:(nullable NSDictionary *)jsonObj;
+ (nullable NSMutableArray *)serializeWithJsonObjects:(nullable NSArray *)jsonObjects;

- (nullable instancetype)init;
- (nullable instancetype)initWithJsonObject:(nullable NSDictionary *)jsonObj;
- (nonnull NSDictionary *)toJsonObject;
@end

#define Biz_Generic_Custom_Array_Class_Define(__className) \
\
@protocol __className<NSObject>\
\
@end \

#define Biz_Generic_Custom_Array_Class_Implement(__className) //Do nothing

#define BizMObjectArray(__className)         NSArray<__className *><__className>
#define BizMObjectMutableArray(__className)  NSMutableArray<__className *><__className>

